XSLT         = xsltproc
XSLT_OPTIONS = --nonet
FOP          = fop-0.95/fop
FOP_OPTIONS  =
FILE_OUTPUT  = CodeProfilingHOWTO
DIR_OUTPUT   = output
DIR_STYLES   = styles
DIR_SRC      = src
OUTPUT       = $(DIR_OUTPUT)/$(FILE_OUTPUT)
TMP          = $(shell ls $(DIR_SRC))
SRCS         = $(TMP:%=src/%)


all: html pdf

$(OUTPUT).html: $(SRCS)
	$(XSLT) $(XSLT_OPTIONS) --output $(OUTPUT).html $(DIR_STYLES)/html.xsl $(DIR_SRC)/core.xml 

$(OUTPUT).fo: $(SRCS)
	$(XSLT) $(XSLT_OPTIONS) --output $(OUTPUT).fo $(DIR_STYLES)/fo.xsl $(DIR_SRC)/core.xml 

$(OUTPUT).pdf: $(OUTPUT).fo $(SRCS)
	$(FOP) $(FOP_OPTIONS) $< $@

html: $(OUTPUT).html
fo:   $(OUTPUT).fo
pdf:  $(OUTPUT).pdf

clean:
	rm $(DIR_OUTPUT)/*

